<%@page import="messages.SystemMessage"%>
<%@page import="util.CountHelper"%>
<%
	//recuperer le id du detaillant
	if (request.getParameter(SystemMessage.DETAILLANT_ID) != null && request.getParameter(SystemMessage.DETAILLANT_ID) != "") 
	{
		 int idDet = Integer.parseInt(request.getParameter( SystemMessage.DETAILLANT_ID ));
		 session.setAttribute( SystemMessage.DETAILLANT_ID, idDet );
	}
%>
<jsp:include page="part/header.jsp" />

		<div data-role="header" >
            <h1>Menu</h1>
            <a href="index.html" data-icon="gear" class="ui-btn-right">Modifier profil</a>
            <a href="index.html" data-icon="back" class="ui-btn-left">Logout</a>
        </div>
 
        <div data-role="content">
            <ul data-role="listview" data-inset="true" data-dividertheme="a">
            	<li data-role="list-divider">Gestion</li>
            	<li><a href="pages/listSuccursales.jsp" data-transition="slide">Succursales</a><span class="ui-li-count"><%=(CountHelper.countSuccFromDet(Integer.parseInt(session.getAttribute(SystemMessage.DETAILLANT_ID).toString())))%></span></li>
            	<li><a href="pages/listPproduits.jsp" data-transition="slide">Produits</a><span class="ui-li-count"><%=(CountHelper.countProdFromDet(Integer.parseInt(session.getAttribute(SystemMessage.DETAILLANT_ID).toString())))%></span></li>
            	<li><a href="pages/listPromotions.jsp" data-transition="slide">Promotions</a><span class="ui-li-count"><%=(CountHelper.countPromFromDet(Integer.parseInt(session.getAttribute(SystemMessage.DETAILLANT_ID).toString())))%></span></li>
            </ul>
            
             <ul data-role="listview" data-inset="true" data-dividertheme="a">
            	<li data-role="list-divider">Statistiques</li>            	
            	<li><a href="pages/statPromotions.jsp" data-transition="slide">Promotion</a></li>
            	<li><a href="pages/statSuccursale.jsp" data-transition="slide">Succursale</a></li>
            </ul>
        </div>

<jsp:include page="part/footer.jsp" />	